<template>
  <div class="user-collect">
    <CollectBlock v-for="item in UserCollect.user_collect.list" :key="item.id" :data="item" />
  </div>
</template>

<script>
import { onActivated } from 'vue'

import CollectBlock from '../../../components/Block/CollectBlock.vue'

import { UserCollectStore } from '@/stores/request'

export default {
  name: 'UserCollect',
  components: {
    CollectBlock
  },
  setup() {
    const UserCollect = UserCollectStore()
    // UserCollect.getUserCollect()
    UserCollect.getUserCollect()

    onActivated(() => {
      UserCollect.getUserCollect()
      console.log(UserCollect.user_collect)
    })

    return {
      UserCollect
    }
  }
}
</script>

<style lang="scss" scoped>
.user-collect {
  display: grid;
  grid-template-columns: repeat(6, 15%);
  grid-gap: 10px 20px;
  padding: 30px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
</style>
